function inicializa_xhr() {
	if (window.XMLHttpRequest) {
		return new XMLHttpRequest();
	} else if (window.ActiveXObject) {
		return new ActiveXObject("Microsoft.XMLHTTP");
	}
}

function cargarCalculoStock() {
	laPeticion = inicializa_xhr();
	if (laPeticion) {
		laPeticion.onreadystatechange = mostrarTablaCalculoStock;
		laPeticion.open("POST", "/Muebles/calcularFueraStock", true);
		laPeticion.setRequestHeader("Content-Type","application/x-www-form-urlencoded");
		
		laPeticion.send();
	}
}

function mostrarTablaCalculoStock() {
	if (laPeticion.readyState == 4) {
		if (laPeticion.status == 200) {
			document.getElementById("stock").innerHTML = laPeticion.responseText;
		}
	}
}


